<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name='format-detection' content='telephone=no' />
<title>人车人</title>
<link rel="icon" href="/assets/img/titleico.ico" type="image/x-icon">
<link rel="stylesheet" href="/assets/css/common.css" />
<link rel="stylesheet" href="/assets/css/iconfont/iconfont.css" />
<link rel="stylesheet" href="/assets/css/uploadInfo.css" />
</head>
<body>
    <!--头部信息-->
    <header>
        <div id="header">
            <div id="goback">
                <i class="inlineBlockImg"></i>
            </div>
            <p>完善资料</p>
            <a href="/userCenter"  class="inlineBlockImg"></a>
        </div>
    </header>
    <!--订单详情-->
    <section>
        <div class="section_tip">
            <p class="section_tip_text">订单详情</p>
        </div>
        <div class="section_main">
            <ul class="section_list" id='tip_list'>
<!--          <li>
                    <div class="section_main_left">
                        <div class="section_main_left_logo">
                            <i class="blockImg userInfoLogo"></i>
                        </div>
                        <div class="section_main_text section_main_text_left">啊啊</div>
                        <div class="section_main_text">12345678910</div>
                    </div>
                    <div class="section_main_left">
                        <span class="section_main_operator">啊啊啊啊</span>
                    </div>
                </li> -->
            </ul>
        </div>
    </section>
<!--查看报告-->
    <section>
        <div class="section_tip">
            <p class="section_tip_text">查看报告</p>
        </div>
        <div style="background-color: #FFF;">
            <ul id="report">
                <li>
                    <div>
                        <div class="section_main_left">
                            <div class="section_main_left_logo">
                                <i class="blockImg pg_reportTipLogo"></i>
                            </div>
                            <div class="section_main_text">车辆评估报告</div>
                        </div>
                        <i class="inlineBlockImg jump"></i>
                    </div>
                    <div class="reportList" id='pg_report'>
                        <!-- <ul>
                            <li>
                                <div><i class="reportListTipLOGO"></i><span class="reportListTip">定价结果</span></div>
                                <ul class="reportMainList">
                                    <li class="reportMainListSection">
                                        <p class="reportKey">s手车</p>
                                        <p class="reportValue">26万</p>
                                    </li>
                                </ul>
                            </li>
                        </ul> -->
                    </div>
                </li>
                <li>
                    <div>
                        <div class="section_main_left">
                            <div class="section_main_left_logo">
                                <i class="blockImg wzcx_reportTipLogo"></i>
                            </div>
                            <div class="section_main_text">违章查询报告</div>
                        </div>
                        <i class="inlineBlockImg jump"></i>
                    </div>
                    <div class="reportList" id='wzcx_report'>

                    </div>
                </li>
            </ul>
        </div>
    </section>
    <!--完善资料-->
    <section>
        <div class="section_tip">
            <p class="section_tip_text">完善资料</p>
        </div>
        <div class="section_main">
            <ul class="section_list" id='data_list'>
          <!-- <li>
                    <div class="section_main_left">
                        <div class="section_main_data_logo">
                            <i class="blockImg cardPhoto"></i>
                        </div>
                        <div class="section_main_text section_main_text_left">啊啊啊啊</div>
                    </div>
                    <div class="section_main_left">
                        <div class="progress_logo_border">
                            <img src="/assets/img/已上传@2x111.png" alt="" class="progress_logo">
                        </div>
                        <i class="inlineBlockImg jump"></i>
                    </div>
                </li> -->
            </ul>
        </div>
    </section>

<!-- 悬浮回到顶部 -->
<div id='toTopBtn'>
</div>

<script src="/assets/js/jquery-3.1.1.min.js"></script>
<script src="/assets/js/fastclick.min.js"></script>
<script src="/assets/js/xxsg.js"></script>
<script>

	$(function(){
		
		$('#goback').click(function(e){
			e.preventDefault();
			location.href='/userCenter/orderList';
			
		})
		$('#report').on('click','li>div:first-child',function(){
			$(this).siblings().toggleClass('active');
			if($(this).siblings().hasClass('active')){
				$('#toTopBtn').css({zIndex:'1'});
				$(this).children('i').css({transform:'rotate(90deg)'});
			}else{
				$('#toTopBtn').css({zIndex:'-1'});
				$(this).children('i').css({transform:'rotate(0deg)'});
			}
		})
		$('#toTopBtn').click(function(){
            $('body').animate({scrollTop: 0}, 500);
		})
		var orderid = window.sessionStorage['orderid'];
		$.ajax({
			url:'/makeprice/queryCarIllegalReport',
			type:'get',
			data:{order_id:orderid},
			success:function(data){
				console.log(data);
				var violationsMap = {
					time:'违章时间',
					fine:'罚款金额',
					address:'违章地址',
					reason:'违章原因',
					point:'违章扣分',
					violationCity:'违章发生城市',
					province:'省份',
					city:'城市',
					serviceFee:'服务费',
					markFee:'代扣分费用',
					processStatus:'违章处理状态',
					violationNum:'违章官方编码',
					paymentStatus:'违章缴费状态',
					organName:'交警队',
					code:'违章编码',
					canSelect:'能否勾选办理'
				}
				var wzcx_reportHTML = '';
				var violations = data.data.violations[0];
				wzcx_reportHTML += `
				<ul>
	                <li>
	                    <div><i class="reportListTipLOGO"></i><span class="reportListTip">违章基本信息</span></div>
	                    <ul class="reportMainList">
	                        <li class="reportMainListSection">
	                            <p class="reportKey">未处理违章总罚款:</p>
	                            <p class="reportValue">${data.data.totalFine == null ? '无':data.data.totalFine}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">未处理违章总扣分:</p>
	                            <p class="reportValue">${data.data.totalPoints == null ? '无':data.data.totalPoints}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">未处理违章条数:</p>
	                            <p class="reportValue">${data.data.untreated == null ? '无':data.data.untreated}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">违章总条数:</p>
	                            <p class="reportValue">${data.data.amount == null ? '无':data.data.amount}</p>
	                        </li>
	                    </ul>
	                </li>
	            </ul>
				`
				wzcx_reportHTML += `
				<ul>
	                <li>
	                    <div><i class="reportListTipLOGO"></i><span class="reportListTip">详细信息</span></div>
	                    <ul class="reportMainList">
	            `
				
				 for(key in violations){
					 if(key == 'processStatus'){
						 wzcx_reportHTML += `
			               <li class="reportMainListSection">
			                    <p class="reportKey">${violationsMap[key]}:</p>
			                    <p class="reportValue">${violations[key] == null||'' ? '无':violations[key] == 1?'未处理':violations[key]==2?'处理中':violations[key]==3?'已处理':violations[key]==4?'不支持':violations[key]}</p>
			               </li>
						`
					 }else if(key == 'paymentStatus'){
						 wzcx_reportHTML += `
			               <li class="reportMainListSection">
			                    <p class="reportKey">${violationsMap[key]}:</p>
			                    <p class="reportValue">${violations[key] == null||'' ? '无':violations[key] == 1?'未缴费':violations[key]==2?'已缴':'无法获取该信息'}</p>
			               </li>
						` 
					 }else if(key == 'canSelect'){
						 wzcx_reportHTML += `
			               <li class="reportMainListSection">
			                    <p class="reportKey">${violationsMap[key]}:</p>
			                    <p class="reportValue">${violations[key] == null||'' ? '无':violations[key] == 0?'不可勾选':violations[key]==1?'可勾选':violations[key]}</p>
			               </li>
						` 
					 }else if(key == 'violationCity'){
						 wzcx_reportHTML += `
			               <li class="reportMainListSection">
			                    <p class="reportKey">${violationsMap[key]}:</p>
			                    <p class="reportValue">${violations[key] == '' ? '无':violations[key]}</p>
			               </li>
						` 
					 }else{
						 wzcx_reportHTML += `
			               <li class="reportMainListSection">
			                    <p class="reportKey">${violationsMap[key]}:</p>
			                    <p class="reportValue">${violations[key] == null||'' ? '无':violations[key]}</p>
			               </li>
						`
					 }
				} 
	            wzcx_reportHTML += `
	                    </ul>
		                </li>
		            </ul>
					`
			
				$('#wzcx_report').html(wzcx_reportHTML);
			}
		})
		$.ajax({
			url:'/makeprice/queryReport',
			type:'get',
			data:{order_id:orderid},
			success:function(data){
				console.log(data);
				var carBaseInfo = data.carBaseInfo,
					carStateInfo = data.carStateInfo,
					priceAnalysis = data.priceAnalysis,
					priceInfo = data.priceInfo;
				
				var pg_reportHTML = '';
				
				var CarAgeYear = priceAnalysis.age/12;
				
				pg_reportHTML += `
				<ul>
	                <li>
	                    <div><i class="reportListTipLOGO"></i><span class="reportListTip">车辆基本信息</span></div>
	                    <ul class="reportMainList">
	                        <li class="reportMainListSection">
	                            <p class="reportKey">车型:</p>
	                            <p class="reportValue">${carBaseInfo.carType == null ? '无':carBaseInfo.carType}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">所在地:</p>
	                            <p class="reportValue">${carBaseInfo.address == null ? '无':carBaseInfo.address}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">上牌日期:</p>
	                            <p class="reportValue">${carBaseInfo.regDate == null ? '无':carBaseInfo.regDate}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">公里数:</p>
	                            <p class="reportValue">${carBaseInfo.mile == null ? '无':carBaseInfo.mile}</p>
	                        </li>
	                        <li class="reportMainListSection">
		                        <p class="reportKey">车身颜色:</p>
		                        <p class="reportValue">${carBaseInfo.color == null ? '无':carBaseInfo.color}</p>
		                    </li>
	                    </ul>
	                </li>
	            </ul>
	            <ul>
	                <li>
	                    <div><i class="reportListTipLOGO"></i><span class="reportListTip">车况</span></div>
	                    <ul class="reportMainList">
	                        <li class="reportMainListSection">
	                            <p class="reportKey">重大修复:</p>
	                            <p class="reportValue">${carStateInfo.overhaulState == null ? '无':carStateInfo.overhaulState}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">漆面状况:</p>
	                            <p class="reportValue">${carStateInfo.surface == null ? '无':carStateInfo.surface}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">内饰成色:</p>
	                            <p class="reportValue">${carStateInfo.interior == null ? '无':carStateInfo.interior}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">工况:</p>
	                            <p class="reportValue">${carStateInfo.workstate == null ? '无':carStateInfo.workstate}</p>
	                        </li>
	                    </ul>
	                </li>
	            </ul>
	            <ul>
	                <li>
	                    <div><i class="reportListTipLOGO"></i><span class="reportListTip">车辆售价影响因素分析</span></div>
	                    <ul class="reportMainList">
	                        <li class="reportMainListSection">
	                            <p class="reportKey">新车价:</p>
	                            <p class="reportValue">${priceAnalysis.newCarPrice == null ? '无':priceAnalysis.newCarPrice}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">车龄:</p>
	                            <p class="reportValue">${priceAnalysis.age == null ? '无':CarAgeYear+'年'}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">里程数:</p>
	                            <p class="reportValue">${priceAnalysis.mile == null ? '无':priceAnalysis.mile}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">过户次数:</p>
	                            <p class="reportValue">${priceAnalysis.transfer_times == null ? '无':priceAnalysis.transfer_times}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">车身颜色:</p>
	                            <p class="reportValue">${priceAnalysis.color == null ? '无':priceAnalysis.color}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">是否热门车型:</p>
	                            <p class="reportValue">${priceAnalysis.isHot == null ? '无':priceAnalysis.isHot == 0 ? '否':'是'}</p>
	                        </li>
	                    </ul>
	                </li>
	            </ul>
	            <ul>
	                <li>
	                    <div><i class="reportListTipLOGO"></i><span class="reportListTip">定价结果</span></div>
	                    <ul class="reportMainList">
	                        <li class="reportMainListSection">
	                            <p class="reportKey">收车价:</p>
	                            <p class="reportValue">${priceInfo.recycPrice == null ? '无':priceInfo.recycPrice}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">同行业交易价:</p>
	                            <p class="reportValue">${priceInfo.salePrice == null ? '无':priceInfo.salePrice}</p>
	                        </li>
	                        <li class="reportMainListSection">
	                            <p class="reportKey">零售价:</p>
	                            <p class="reportValue">${priceInfo.price == null ? '无':priceInfo.price}</p>
	                        </li>
	                    </ul>
	                </li>
	            </ul>
				`	
				$('#pg_report').html(pg_reportHTML);
			}
		})
		
		$.ajax({
			url:'/userCenter/getCustomerInfo',
			type:'get',
			success:function(data){
				
				var html = '';
				if(data.term == null){
					data.term = 0;
				}
				html += `
				
				<li>
	                <div class="section_main_left">
	                    <div class="section_main_left_logo">
	                        <i class="blockImg userInfoLogo"></i>
	                    </div>
	                    <div class="section_main_text section_main_text_left">${data.name}</div>
	                    <div class="section_main_text">${data.phone}</div>
	                </div>
	                <div class="section_main_left">
	                    <span class="section_main_operator">${data.Operator}</span>
	                </div>
	            </li>
	            <li>
	                <div class="section_main_left">
	                    <div class="section_main_left_logo">
	                        <i class="blockImg detailLogo"></i>
	                    </div>
	                    <div class="section_main_text section_main_text_left">车速融</div>
	                    <div class="section_main_text">${data.term}期</div>
	                </div>
	            </li>
				
				
				`
				$('#tip_list').html(html);
			}
		})
		
		$.ajax({
			url:'/makeprice/getOrderStep',
			type:'get',
			success:function(data){
				//console.log(data);
				var html = '';
				
				var logoImg = '';
				var map = {
						0:'<img src="/assets/img/未上传@2x111.png" alt="" class="progress_logo">',
						1:'<img src="/assets/img/待完善@2x.png" alt="" class="progress_logo_fk">',
						2:'<img src="/assets/img/已上传@2x111.png" alt="" class="progress_logo">',
						3:'<img src="/assets/img/反馈2@2x111.png" alt="" class="progress_logo_fk">',
						4:'<img src="/assets/img/已上传@2x111.png" alt="" class="progress_logo">',
						5:'<img src="/assets/img/已通过@2x.png" alt="" class="progress_logo">',
						6:'<img src="/assets/img/已上传@2x111.png" alt="" class="progress_logo">'
				}
								
				
				html += `
				
				<li>
	                <a href='/makeprice/uploadCred/2'>
		                <div class="section_main_left">
		                    <div class="section_main_data_logo">
		                        <i class="blockImg cardPhoto"></i>
		                    </div>
		                    <div class="section_main_text section_main_text_left">原件照片</div>
		                </div>
		                <div class="section_main_left">
		                    <div class="progress_logo_border">
		                    	${map[data.credPho]}
		                    </div>
		                    <i class="inlineBlockImg jump"></i>
		                </div>
	                </a>
	            </li>
	            <li>
	            	<a href='/makeprice/uploadCred/3'>
		            	<div class="section_main_left">
		                    <div class="section_main_data_logo">
		                        <i class="blockImg carPhoto"></i>
		                    </div>
		                    <div class="section_main_text section_main_text_left">车辆照片</div>
		                </div>
		                <div class="section_main_left">
		                    <div class="progress_logo_border">
		                    	${map[data.carPho]}
		                    </div>
		                    <i class="inlineBlockImg jump"></i>
		                </div>
	            	</a>
	                
	            </li>
	            <li>
		            <a href='/bargain'>
			            <div class="section_main_left">
		                    <div class="section_main_data_logo">
		                        <i class="blockImg ApplyForContract"></i>
		                    </div>
		                    <div class="section_main_text section_main_text_left">合同申请</div>
		                </div>
		                <div class="section_main_left">
		                    <div class="progress_logo_border">
		                    	${map[data.bargainReview]}
		                    </div>
		                    <i class="inlineBlockImg jump"></i>
		                </div>
	            	</a>
	                
	            </li>
	            <li>
		            <a href='/bargainUpload'>
			            <div class="section_main_left">
		                    <div class="section_main_data_logo">
		                        <i class="blockImg contractUpload"></i>
		                    </div>
		                    <div class="section_main_text section_main_text_left">合同上传</div>
		                </div>
		                <div class="section_main_left">
		                    <div class="progress_logo_border">
		                    	${map[data.bargainPho]}
		                    </div>
		                    <i class="inlineBlockImg jump"></i>
		                </div>
	            	</a>
	                
	            </li>
	            <li>
		            <a href='/supply/supply'>
			            <div class="section_main_left">
		                    <div class="section_main_data_logo">
		                        <i class="blockImg dataSupplement"></i>
		                    </div>
		                    <div class="section_main_text section_main_text_left">资料补充</div>
		                </div>
		                <div class="section_main_left">
		                    <div class="progress_logo_border">
		                    	${map[data.supply]}
		                    </div>
		                    <i class="inlineBlockImg jump"></i>
		                </div>
	            	</a>
	                
	            </li>
	            <li>
	            	<a href='/download/download'>
		                <div class="section_main_left">
		                    <div class="section_main_data_logo">
		                        <i class="blockImg contractDown"></i>
		                    </div>
		                    <div class="section_main_text section_main_text_left">合同下载</div>
		                </div>
	                </a>
	            </li>
				
				`
				
				$('#data_list').html(html);
			}
		})
	})
</script>
</body>
</html>